<template>
	<view class="playList">
		<z-paging ref="paging" v-model="dataList" @query="queryList" :default-page-size="15" empty-view-text="暂无中奖记录">
			<template #loading>
				<uni-load-more status="loading"></uni-load-more>
			</template>
			<view class="list">
				<view class="row" v-for="(item,index) in dataList" :key="item">
					<Award-item :writeoff="true"></Award-item>
				</view>
			</view>
		</z-paging>

		<uni-fab ref="fab" :pattern="{icon:'scan'}" horizontal="right" vertical="bottom" @fabClick="fabClick" />
	</view>
</template>

<script setup>
	import {
		ref
	} from "vue"
	const paging = ref(null);
	const dataList = ref([]);
	const queryList = (pageNo, pageSize) => {
		setTimeout(() => {
			paging.value.complete([]);
		}, 1000)
	}

	const fabClick = () => {
		uni.scanCode({
			success: res => {
				console.log(res)
			},
			fail: err => {
				console.log(err)
			}
		})
	}
</script>

<style lang="scss" scoped>
	.playList {
		.list {
			padding: 30rpx;

			.row {
				margin-bottom: 30rpx;
			}
		}
	}
</style>